<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/11/13
  Time: 21:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%pageContext.setAttribute("APP_PATH", request.getContextPath());%>
<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.2</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />

    <link rel="stylesheet" href="${APP_PATH}/recourse/css/font.css">
    <link rel="stylesheet" href="${APP_PATH}/recourse/css/login.css">
    <link rel="stylesheet" href="${APP_PATH}/recourse/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="${APP_PATH}/recourse/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${APP_PATH}/recourse/js/xadmin.js"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <table class="layui-table" lay-data="{page:true,toolbar: '#toolbarDemo',id:'test'}" lay-filter="test" id = "table">
                        <thead>
                        <tr>
                            <th lay-data="{type:'checkbox'}"></th>
                            <th lay-data="{field:'id', width:80, sort: true}">序号</th>
                            <th lay-data="{field:'username', minwidth:100, sort: true}">维修单名称</th>
                            <th lay-data="{field:'start',minWidth: 100}">发起时间</th>
                            <th lay-data="{field:'unit',minWidth: 100}">维修公司</th>
                            <th lay-data="{field:'local', minwidth:100}">预估开始维修时间</th>
                            <th lay-data="{field:'local', minwidth:100}">预估结束维修时间</th>
                            <th lay-data="{field:'department',minWidth: 100}">预估价格(元)</th>
                            <th lay-data="{field:'wrok', sort: true,minWidth: 100}">报修人员</th>
                            <th lay-data="{field:'wrokstation', sort: true,minWidth: 100}">报修单位</th>
                            <th lay-data="{field:'operate', sort: true,minWidth: 100}">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${bid}" var="order" varStatus="status">
                            <tr>
                                <td></td>
                                <td>${status.index+1}</td>
                                <td>${list.order_name}</td>
                                <td><fmt:formatDate value="${list.createTime}" type="date"/></td>
                                <td>${order.maintenance_company_name}</td>
                                <td><fmt:formatDate value="${order.start_time}" type="date"/></td>
                                <td><fmt:formatDate value="${order.finished_time}" type="date"/></td>
                                <td>${order.estimated_price}</td>
                                <td>${list.equipment_admin_name}</td>
                                <td>${list.insiderUnit_name}</td>
                                <td class="td-manage">
                                    <a class="layui-btn layui-btn-primary layui-btn-xs" href="${pageContext.request.contextPath}/approver/newBid?id=${list.id}&com_id=${order.company_id}">选择</a>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>layui.use('laydate',
    function() {
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });

    });</script>
<script>layui.use('table',
    function() {
        var table = layui.table;

        //监听单元格编辑
        table.on('edit(test)',
            function(obj) {
                var value = obj.value //得到修改后的值
                    ,
                    data = obj.data //得到所在行所有键值
                    ,
                    field = obj.field; //得到字段
                layer.msg('[ID: ' + data.id + '] ' + field + ' 字段更改为：' + value);
            });

        //头工具栏事件
        table.on('toolbar(test)',
            function(obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    case 'getCheckData':
                        var data = checkStatus.data;
                        layer.alert(JSON.stringify(data));
                        break;
                    case 'getCheckLength':
                        var data = checkStatus.data;
                        layer.msg('选中了：' + data.length + ' 个');
                        break;
                    case 'isAll':
                        layer.msg(checkStatus.isAll ? '全选': '未全选');
                        break;
                };
            });
    });</script>

<script>var _hmt = _hmt || []; (function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();</script>

</html>
